﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MongoDB.Driver;

namespace NDF.Tests.Framework
{
    [TestClass]
    public class MongoDBTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            string connectionString = "mongodb://localhost";
            string databaseName = "demoBase";
            string collectionName = "demoCollection";

            MongoServer svr = MongoServer.Create(connectionString);
            MongoDatabase database = svr.GetDatabase(databaseName);
            MongoCollection collection = database.GetCollection(collectionName);

            svr.Connect();

            var obj = new { Uid = 123, Name = "ChenJianwei", Password = "123456" };
            collection.Insert(obj);

            var query = new QueryDocument();
            //foreach (var item in collection.Find)
        }
    }
}
